# -*- encoding:utf-8 -*-

from taobao.response import TaobaoListResponse

class ItemsSearchResponse(TaobaoListResponse):
    """ 调用 taobao.item.get 得到单个商品时 返回的response"""

    def __init__(self, rsp=None):
        """
            @ rsp : TaobaoListResponse
        """

        # List<ItemSearch> search
        self.search = []
        super(ItemsSearchResponse, self).__init__(rsp)
        
        self.setTaobaoObject(rsp.getTaobaoObject())
        self.setTotalResults(len(rsp.getTaobaoObject()))
        self.search = rsp.getTaobaoObject()
    
    def setSearch(self, search):
        self.search = search

    def getSearch(self):
        return self.search
